package com.lucenten.collect.gnss.handler.files;

public class AzimuthElevation {

    protected static double getAtan(double z, double y) {
//        System.out.println("getAtan:"+z+":"+y);
        if (z == 0) {
            return 0;
        }
        if (y == 0) {
            return Math.PI;
        }
        double x = Math.atan(Math.abs(y / z));
        if (y > 0 && z < 0) {
            return Math.PI - x;
        }
        if (y < 0 && z < 0) {
            x =  Math.PI + x;
        }
        if (y <0 && z > 0) {
            x = 2 *  Math.PI - x;
        }
        return x;
    }
}
